package com.neuedu.controller;


import com.neuedu.entity.User;
import com.neuedu.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @Author: MARK
 * @Date: 2019/7/29 19:14
 * @version: 1.0.0
 * @Description:
 */

@Controller
@Slf4j
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/user")
    // @GetMapping("/u")
    public ModelAndView users(){
        List<User> list = userService.getAll();
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("list", list);
        modelAndView.setViewName("/user/user");
        return modelAndView;
    }
}
